<extend name="Layout/ins_page" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">

	<select name="folder_list" id="folder_list" class="hidden">
		<option value="0">根节点</option>
		{:fill_option($folder_list)}
	</select>


	{:W('PageHeader/simple',array('name'=>$folder_name,'search'=>'N'))}
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-right">

				<a onclick="save()" class="btn btn-sm btn-primary">保存</a>

			</div>
		</div>
	</div>
	<div class="row">

		<!--<div class="col-sm-4 sub_left_menu ">-->
			<!--<div class="well">-->
				<!--<?php echo $menu ?>-->
			<!--</div>-->
		<!--</div>-->

		<div class="col-sm-12">
			<form id="form_data" name="form_data" method="post" class="well form-horizontal clearfix" >
				<div class="form-group">
					<label class="col-sm-3 control-label" for="carNum">车牌号*：</label>
					<div class="col-sm-9">
						<input class="form-control" type="text" id="carNum" name="carNum" check="require" msg="请输入车牌号">
					</div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="carType">车型*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="carType" name="carType" check="require" msg="请输入车型">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="EngineNum">发动机号*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="EngineNum" name="EngineNum" check="require" msg="请输入发动机号">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="DipanNum">底盘号码*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="DipanNum" name="DipanNum" check="require" msg="请底盘号码">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="oilCardNum">油卡号*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="oilCardNum" name="oilCardNum" check="require" msg="请输入油卡号">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="oilUse">油耗*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="oilUse" name="oilUse" check="require" msg="请输入油耗">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="insurer">保险公司*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="insurer" name="insurer" check="require" msg="请输入保险公司">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="insurePhone">保险电话*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="insurePhone" name="insurePhone" check="require" msg="请输入保险电话">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="price">购买价格*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="price" name="price" check="require" msg="请输入购买价格">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="color">车身颜色*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="color" name="color" check="require" msg="请输入车身颜色">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="make">生产厂商*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="make" name="make" check="require" msg="请输入生产厂商">
                    </div>
                </div>
                <div class="form-group ">
                    <label class="col-sm-3 control-label" for="chuchangDate">出厂日期*：</label>
                    <div class="col-sm-9">
                        <div class="input-daterange input-group">
                             <input class="input-sm form-control text-center"  readonly="readonly" type="text" id="chuchangDate" name="chuchangDate" check="require" msg="请输入出厂日期">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="struct">结构特点：</label>
                    <div class="col-sm-9">
                        <select class="form-control"  name="struct" id="struct">
                            <option  value="0">手动</option>
                            <option value="1">自动</option>
                         </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label" for="state">状态：</label>
                    <div class="col-sm-9">
                        <select class="form-control"  name="state" id="state">
                            <option  value="0" selected>正常</option>
                            <option value="1">维修</option>
                            <option value="2">使用</option>
                        </select>
                    </div>
                </div>
                <div class="form-group ">
                    <label class="col-sm-3 control-label" for="motDate">年检日期*：</label>
                    <div class="col-sm-9">
                        <div class="input-daterange input-group">
                            <input class="input-sm form-control text-center"  readonly="readonly" type="text" id="motDate" name="motDate" check="require" msg="请输入出厂日期">
                        </div>
                    </div>
                </div>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function save() {
            if (check_form("form_data")) {
                var vars = $("#form_data").serialize();
                    sendAjax("{:U('addCarInfo')}", vars, function(data) {
                        if (data.status) {
                            ui_alert(data.info, function() {
                               // parent.location.reload(true);
                                location.href="{:U('showCarInfoList')}";
                            });
                        }else{
                            ui_error(data.info);
                        }
                    });
                }else{
                    ui_error("未修改任何数据项");
                }
        }
    </script>
</block>